package com.whcoding.test.pojo;

import com.whcoding.test.annotion.InConstraint;
import com.whcoding.test.annotion.IsMobile;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @program: spring-boot-learning
 * @description:
 * @author: whcoding
 * @create: 2022-08-01 10:58
 **/

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ValidationParamVO {

	@Max(value = 10, message = "最大值不能大于10")
	private Integer userCode;

	@NotNull(message = "部门名称不能为空")
	private String userName;

	@NotNull(message = "手机号码不能为空")
	@IsMobile
	private String mobile;

	/**
	 * 用户部门名称
	 */
	@InConstraint(value = {"开发", "测试", "产品"}, message = "只能输入开发、测试、产品")
	private String userDeptName;

	/**
	 * 嵌套验证
 	 */
	@Valid
	private UserTestVO userVO;
}

